package cn.amossun.starter.mybatis.data.security.interceptor;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.executor.parameter.ParameterHandler;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Signature;

import java.sql.PreparedStatement;

/**
 * @description:
 * @author: Amos.Sun
 * @DateTime: 2020/03/08 15:23
 **/
@Slf4j
@Intercepts(
        @Signature(type = ParameterHandler.class, method = "setParameters", args = {PreparedStatement.class})
)
@AllArgsConstructor
public class ParameterHandlerInterceptor implements Interceptor {

    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        return invocation.proceed();
    }

}
